import OrderDetail from './OrderDetail'
import * as actions from '../../redux/actions/OrderAction'
import { StoreState } from '../../redux/Types'
import { Dispatch } from 'redux'
import { connect } from 'react-redux'


export function mapStateToProps({order: { record, head, detailData, loading }, user }: StoreState) {
  return {
    head,
    record,
    data: detailData,
    loading,
    user
  }
}
export function mapDispatchToProps(dispatch: Dispatch<actions.OrderAction>) {
  return {
    list: (data: any, page: any) => {
      // dispatch(actions.pageDetail(page))
      dispatch(actions.getOrderDetailList({
        ...data,
        appid: 'SORDERLISTITEM'
      }))
    },
  }
}
export default connect(mapStateToProps, mapDispatchToProps)(OrderDetail)